<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/mod2016/include/taglib.jsp"%>

<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<%@ include file="/WEB-INF/views/mod2016/include/head.jsp"%>
	<title>报表配置</title>
</head>

<body class="bg-gray">
<jsp:include page="/pub/include/top"/>
<div class=" cbox clearfix mgt-10">
	<jsp:include page="/pub/include/nav?navCode=${report.menuCode==null?'configList':report.menuCode}"/>
	<div class="con-wr mgb-10  fr">
		<!-- 面包屑 start -->

		<c:if test="${report.menuCode==null}">
			<jsp:include page="/pub/include/bread?navCode=configList&fourHref=${nowHref}&fourMenu=${report.reportName}" />
		</c:if>
		<c:if test="${report.menuCode!=null}">
			<jsp:include page="/pub/include/bread?navCode=${report.menuCode}" />
		</c:if>

		<!-- 面包屑 end -->
		<!-- 三级菜单 start-->
		<c:if test="${report.menuCode==null}">
			<jsp:include page="/pub/include/threeNav?menuName=${report.reportName}" />
		</c:if>
		<c:if test="${report.menuCode!=null}">
			<jsp:include page="/pub/include/threeNav?navCode=${report.menuCode}" />
		</c:if>
		<!-- 三级菜单 end-->

		<!-- 此处为页面代码 start-->
		<div class="searchbar searchbar-n bg-white ">
			<form:form id="searchForm" action="${ctx}/report/produce/?reportId=${report.reportId}" method="post">
				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

				<table border="0">
					<c:forEach items="${report.reportConfigIns}" var="reportConfigIn" varStatus="status">
						<c:choose>
							<c:when test="${status.index%3==0 }">
								<tr>
							</c:when>
						</c:choose>

						<div class="fl mgb-10 mgr-20">
							<span class="fl  w100-tr">${reportConfigIn.itemName }：</span>
							<%--文本--%>
							<c:if test="${reportConfigIn.itemType eq '0' }">
								<input type="text" name="${reportConfigIn.itemCode}" class="w-input162"
									   value="${reportConfigIn.paramValue }"/>
							</c:if>
							<%--数字--%>
							<c:if test="${reportConfigIn.itemType eq '1' }">
								<input type="text" name="${reportConfigIn.itemCode }" class="w-input162 digits"
									   value="${reportConfigIn.paramValue }"/>
							</c:if>
							<%--静态字典数据--%>
							<c:if test="${reportConfigIn.itemType eq '2' or reportConfigIn.itemType eq '3' or reportConfigIn.itemType eq '4'  }">
								<select name="${reportConfigIn.itemCode }" class="w-input180" value="${reportConfigIn.paramValue }">
									<option value="">请选择</option>
									<c:forEach items="${reportConfigIn.selectList}" var="dict">
										<c:choose>
											<c:when test="${reportConfigIn.paramValue eq  dict.value}">
												<option value="${dict.value }" selected="selected">${dict.label }</option>
											</c:when>
											<c:otherwise>
												<option value="${dict.value }">${dict.label }</option>
											</c:otherwise>
										</c:choose>
									</c:forEach>
								</select>
							</c:if>
							<%--日期--%>
							<c:if test="${reportConfigIn.itemType eq '5' }">
								<input id="${reportConfigIn.itemCode }" name="${reportConfigIn.itemCode }" value="${reportConfigIn.paramValue}"
									   type="text" maxlength="20" class="Wdate input-n4 fl w-input162"
									   onclick="WdatePicker({dateFmt:'${reportConfigIn.checkType}',isShowClear:false});"/>
							</c:if>
						</div>
						<c:if test="${status.last}">
							<div class="mgl-100 clear ">
								<input type="submit" value="查询" class="btn-yellow mgl-8">
								<input type="button" value="清空" class="btn-gray-outline mgl-10 _goReset">
							</div>
						</c:if>
					</c:forEach>
				</table>
			</form:form>
		</div>

		<div class="list-top pdlr-20 clear pdt-5">
			<div class="list-title fl fs14">业务列表<span class="fs12 font-gray">（共${page.count}条）</span>
				<a href="javascript:history.go(0)"><i></i></a>
			</div>
			<c:if test="${report.isExport eq '1' }">
			<div class="list-manage fr">
				<c:if test="${report.isExportAsyn=='2'||report.isExportAsyn=='0'}">
				<a href="javascript:void(0);" onclick="goExport('${report.reportId}','0')" class="font-blue">同步导出</a><span>|</span>
				</c:if>
				<c:if test="${report.isExportAsyn=='2'||report.isExportAsyn=='1'}">
				<a href="javascript:void(0);" onclick="goExport('${report.reportId}','1')" class="font-blue">异步导出</a>
				</c:if>
			</div>
			</c:if>
		</div>

		<div class="list-con clear">
			<div style="overflow-x: scroll;">
				<table border="0" width="100%" class="table-style4 js_table_style4 word-break"  style="width: 948px; overflow: scroll;">
					<thead>
					<tr class="erow">
						<c:forEach items="${out1}" var="o1">
							<th rowspan="${o1.spanValue}" scope="col" style="border: 1px solid #ddd;">${o1.itemName}</th>
						</c:forEach>
						<c:forEach items="${out2}" var="o2">
							<th colspan="${o2.spanValue}" scope="col" style="border: 1px solid #ddd;">${o2.itemName}</th>
						</c:forEach>
					</tr>
					<tr>
						<c:forEach items="${out0}" var="o0">
							<th scope="col" style="border: 1px solid #ddd;">${o0.itemName}</th>
						</c:forEach>
					</tr>

					<%--<tr class="erow">--%>
						<%--&lt;%&ndash;<td><div class="check-box"><i class="ico-check" id="checkAll"></i></div></td>&ndash;%&gt;--%>
						<%--<c:forEach items="${report.reportConfigOuts}" var="reportConfigOut">--%>
							<%--<td style="border: 1px solid #ddd;">${reportConfigOut.itemName }</td>--%>
						<%--</c:forEach>--%>
					<%--</tr>--%>
					</thead>
					<tbody>
					<c:forEach items="${page.list}" var="map">
						<tr>
							<%--<td><div class="check-box"><i class="ico-check"></i></div></td>--%>
							<c:forEach items="${report.reportConfigOuts}" var="reportConfigOut">
								<td>${map[reportConfigOut.itemCode]}</td>
							</c:forEach>
						</tr>
					</c:forEach>
					</tbody>
				</table>
			<%--<table border="0" width="100%" class=" table-style4  js_table_style4">--%>
				<%--<thead>--%>
				<%--<tr class="erow">--%>
					<%--<td>--%>
						<%--<div class="check-box"><i class="ico-check" id="checkAll"></i></div>--%>
					<%--</td>--%>
					<%--<c:forEach items="${report.reportConfigOuts}" var="reportConfigOut">--%>
						<%--<td style="border: 1px solid #ddd;">${reportConfigOut.itemName }</td>--%>
					<%--</c:forEach>--%>
				<%--</tr>--%>
				<%--</thead>--%>
				<%--<tbody>--%>
					<%--<c:forEach items="${page.list}" var="map">--%>
					<%--<tr>--%>
						<%--<td><div class="check-box"><i class="ico-check"></i></div></td>--%>
						<%--<c:forEach items="${report.reportConfigOuts}" var="reportConfigOut">--%>
							<%--<td>${map[reportConfigOut.itemCode]}</td>--%>
						<%--</c:forEach>--%>
					<%--</tr>--%>
					<%--</c:forEach>--%>
				<%--</tbody>--%>
			<%--</table>--%>
			</div>
		</div>
		<div class="pagination clear "> ${page}</div>
	</div>
</div>
</body>
<script type="text/javascript" src="${ctxStatic }/plat2016/public/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${ctxStatic}/plat2016/public/js/hui.common.js?v=110"></script>
<script type="text/javascript">
    var msg = "${message}";
    function goExport(reportId,isAsyn) {
        var searchForm = $("#searchForm");
        var action = searchForm.attr("action");
        console.log("reportId:" + reportId);
        confirmx('确认导出吗？', function () {
            searchForm.attr("action","${ctx}/report/produce/export?reportId=" + reportId+"&isExportAsyn="+isAsyn);
            searchForm.submit();
            searchForm.attr("action",action);
        });
    }

</script>
</html>
